package com.example.lx6_3.adapter

import android.provider.ContactsContract.Data
import androidx.databinding.DataBindingUtil
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.base.entity.VisitEntityItem
import com.example.lx6_3.R
import com.example.lx6_3.databinding.ItemVisitBinding

class VisitAdapter : BaseQuickAdapter<VisitEntityItem, BaseViewHolder>(R.layout.item_visit) {

    override fun onItemViewHolderCreated(viewHolder: BaseViewHolder, viewType: Int) {
        super.onItemViewHolderCreated(viewHolder, viewType)
        DataBindingUtil.bind<ItemVisitBinding>(viewHolder.itemView)
    }

    override fun convert(helper: BaseViewHolder, item: VisitEntityItem) {
        val binding = DataBindingUtil.getBinding<ItemVisitBinding>(helper.itemView)
        binding?.vis = item
    }
}